package com.dorado.example.mq.producer;

import com.dorado.example.dto.TestModelDTO;
import com.dorado.kernel.core.annotation.Consumer;
import com.dorado.kernel.messaging.annotation.MQProducer;
import com.dorado.kernel.messaging.enums.MessageType;
import com.dorado.example.vo.OrderModelVo;

import java.util.List;

@Consumer
public interface IOrderMqService {
    /**
     * 普通消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", topic ="order_mq", tags = "create1")
    void sendMsg(TestModelDTO order);
    /**
     * 普通消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", topic ="order_mq", tags = "create2")
    void sendMsg2(TestModelDTO order);

    /**
     * 普通消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", groupName ="HYDRA_ORDER_LIST", topic ="order_mq_list", tags = "list", mode= MQProducer.Mode.BATCH, recordTable = "mq_record_noshar" )
    void sendListMsg(List<TestModelDTO> list);


    /**
     * 普通消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", groupName ="HYDRA_ORDER", topic ="order_mq_array", tags = "array", mode= MQProducer.Mode.BATCH/*, recordTable = "mq_record_noshar"*/ )
    void sendArrayMsg(OrderModelVo[] list);


    /**
     * 普通消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", groupName ="HYDRA_TX", topic ="order_tx_mq", tags = "create", messageType = MessageType.TRANSACTION/*, recordTable = "mq_record_noshar"*/ )
    void sendTXMsg(OrderModelVo list);

    /**
     * 单向消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", groupName ="HYDRA_ORDER", topic ="order_mq_oneway", tags = "create",messageType = MessageType.ONEWAY/*,recordTable = "mq_record_noshar"*/)
    void sendOneWayMsg(OrderModelVo order);

    /**
     * 顺序消息生产者-调用
     */
    @MQProducer(name = "RocketMQ1", groupName ="order_orderly_mq", topic ="order_orderly_mq", tags = "create",messageType = MessageType.ORDERLY/*, recordTable = "mq_record_noshar"*/)
    void sendOrderlyMsg(OrderModelVo order);
}